<?php
       $this->setLayout('template'.DS.'default.phtml');
       $this->startBlock();
?>
<script>
    $(function(){
        $('#sort_condition').change(function(){
            if($(this).val()!=' '){
            var subject_id = '<?php echo Kd_Web::getSession()->get('current_subject_id')?>';
            <?php $url = $this->getUrl(null,'subjectconcessions')?>
            self.location="<?php echo $url?>/sort/"+$(this).val()+'/subject_id/'+subject_id;
            }
        })
    })
</script>
<div class ="public_width subject_article_list">
    <h4>
        <label>排序条件:</label>
        <select id="sort_condition">
            <option value=" " selected="selected">--</option>
            <option value="default">时间</option>
            <option value="click_count">点击率</option>
        </select>
        <a href="<?php echo $this->getUrl(NULL,'create','concessions')?>">创建优惠</a>
    </h4>

    <dl>
    <?php foreach($this->concessions as $concessions):?>
        <dt><?php echo $concessions->getName()?></dt>
        <dd>
            <ol>
                <a href="<?php echo $this->getUrl(array('id'=>$concessions->getId()),'edit','concessions')?>">编辑</a>
                <a href="<?php echo $this->getUrl(array('id'=>$concessions->getId()),'preview','concessions')?>">预览</a>
            </ol>
            <ol>
                <ul style="list-style-type: none">
                    <li>分类：<?php echo $concessions->getCategoryName()?></li>
                    <li>点击量：<?php echo $concessions->getClickCount()?></li>
                </ul>
            </ol>
            <br>
        </dd>
    <?php endforeach;?>
    </dl>
</div>
<?php $this->endBlock();?>